﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdbRegisterUtils
{
    public class AddrHelp
    {
        public uint Address { get; set; }
        public uint Data { get; set; }
        public string ID { get; set; }
        public string ReadNO { get; set; }
        public string WriteNo { get; set; }
        public uint BaseAddr { get; set; }

        public AddrHelp(uint address, uint data)
        {
            Address = address;
            Data = data;
            ID = "00";
            ReadNO = "0";
            WriteNo = "1";
        }

        public string Addr => Address.ToString("X8");

        public string GetCommand => $"adb shell setprop vendor.extcamera.xxw.ispregctrl \"{ReadNO},{Addr},{Data.ToString("X2")},{ID}\"";

        public string SetCommand => $"adb shell setprop vendor.extcamera.xxw.ispregctrl \"{WriteNo},{Addr},{Data.ToString("X2")},{ID}\"";
    }
}
